<?php

// Namespace

namespace Loop;


/**
 * IVersionControlDriver is an interface that defines various commands related to version control (e.g. export, checkout...)
 * It must be implemented by a class for each version control platform (e.g. CSubversionDriver for SVN)
 *
 * @package		Loop
 * @category	Driver
 */

interface IVersionControlDriver
{
	/**
	 * Adds a file or directory to the workspace
	 *
	 * @param	string	$path	Path of the file or directory to be added
	 */
	
	public function add($path);
	
	
	/**
	 * Moves a file or directory on the workspace or the repository
	 *
	 * @param	string	$sourcePathOrUrl	Path or URL to the source file or directory to be copied
	 * @param	string	$targetPathOrUrl	Path or URL to the target file or directory
	 * @param	string	$userLogin			The user login (optional)
	 * @param	string	$userPassword		The user password (optional)
	 * @param	string	$commitMessage		The message to put in the commit (optional)
	 */
	
	public function move($sourcePathOrUrl, $targetPathOrUrl, $userLogin = null, $userPassword = null, $commitMessage = null);
	
	
	/**
	 * Deletes a file or directory from the workspace or the repository
	 *
	 * @param	string	$pathOrUrl		Path or URL to the file or directory to be removed
	 * @param	string	$userLogin		The user login (optional)
	 * @param	string	$userPassword	The user password (optional)
	 * @param	string	$commitMessage	The message to put in the commit (optional)
	 */
	
	public function delete($pathOrUrl, $userLogin = null, $userPassword = null, $commitMessage = null);
	
	
	/**
	 * Exports a part of the workspace or repository to a directory
	 *
	 * @param	string	$pathOrUrl		Which part of the project should be exported?
	 * @param	string	$targetPath		Where the export will be stored (locally)
	 * @param	string	$userLogin		The user login (optional)
	 * @param	string	$userPassword	The user password (optional)
	 * @param	string	$commitMessage	The message to put in the commit (optional)
	 */
	
	public function export($pathOrUrl, $targetPath, $userLogin = null, $userPassword = null, $commitMessage = null);
}

?>
